home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Programmer Disk
/
The Programmer Disk (Microforum).iso
/
xpro
/
qb2
/
pro16
/
wdchs.bas
< prev
next >
Wrap
BASIC Source File
|
1992-02-06
|
8KB
|
171 lines
' WDCHS.Bas
' Portions Copyright 1987-1990 Microsoft Corp.
WindowDoComputeHotSpots:
numHSClick = 0
numHSRel = 0
' ====================================================================
' If upper left corder of border is "=", then that's a close box
' Furthermore, a close box is a release type event so store in HSRel
' ====================================================================
IF MID$(border$, 1, 1) = "=" THEN
numHSRel = numHSRel + 1
HSRel(numHSRel).row1 = GloWindow(windo).row1 - 1
HSRel(numHSRel).row2 = GloWindow(windo).row1 - 1
HSRel(numHSRel).col1 = GloWindow(windo).col1 - 1
HSRel(numHSRel).col2 = GloWindow(windo).col1 - 1
HSRel(numHSRel).action = 4
HSRel(numHSRel).misc = windo
END IF
' ====================================================================
' If lower right corner is "+", then that's a re-size box
' Further more, a re-size box is a click event, so store in HSClick
' ====================================================================
IF MID$(border$, 9, 1) = "+" THEN
numHSClick = numHSClick + 1
HSClick(numHSClick).row1 = GloWindow(windo).row2 + 1
HSClick(numHSClick).row2 = GloWindow(windo).row2 + 1
HSClick(numHSClick).col1 = GloWindow(windo).col2 + 1
HSClick(numHSClick).col2 = GloWindow(windo).col2 + 1
HSClick(numHSClick).action = 5
HSClick(numHSClick).misc = 0
END IF
' ====================================================================
' Likewise, a "░" chr$(176) is a move bar. That's also a click event
' ====================================================================
IF MID$(border$, 2, 1) = "░" THEN
numHSClick = numHSClick + 1
HSClick(numHSClick).row1 = GloWindow(windo).row1 - 1
HSClick(numHSClick).row2 = GloWindow(windo).row1 - 1
HSClick(numHSClick).col1 = GloWindow(windo).col1
HSClick(numHSClick).col2 = GloWindow(windo).col2
HSClick(numHSClick).action = 15
HSClick(numHSClick).misc = 0
END IF
' ====================================================================
' Buttons are click, and release events.
' Click, and the cursor goes there, and the button is highlighted.
' Release, and the selection is made
' ====================================================================
IF GloStorage.numButtonsOpen > 0 THEN
button = 0
WHILE button < GloStorage.numButtonsOpen
button = button + 1
IF GloButton(button).windowHandle = windo THEN
numHSClick = numHSClick + 1
HSClick(numHSClick).row1 = _
GloWindow(windo).row1 _
+ GloButton(button).row1 - 1
IF GloButton(button).buttonType = 5 THEN
HSClick(numHSClick).row2 = GloWindow(windo).row1 _
+ GloButton(button).row2
ELSE
HSClick(numHSClick).row2 = GloWindow(windo).row1 _
+ GloButton(button).row1 - 1
END IF
HSClick(numHSClick).col1 = GloWindow(windo).col1 _
+ GloButton(button).col1 - 1
HSClick(numHSClick).col2 = GloWindow(windo).col1 _
+ GloButton(button).col1 _
+ 2 _
+ LEN(RTRIM$(GloButton(button).text$))
HSClick(numHSClick).action = 1
HSClick(numHSClick).misc = GloButton(button).handle
HSClick(numHSClick).misc2 = GloButton(button).buttonType
numHSRel = numHSRel + 1
HSRel(numHSRel).row1 = GloWindow(windo).row1 _
+ GloButton(button).row1 - 1
IF GloButton(button).buttonType = 5 THEN
HSRel(numHSRel).row2 = GloWindow(windo).row1 _
+ GloButton(button).row2 - 1
ELSE
HSRel(numHSRel).row2 = GloWindow(windo).row1 _
+ GloButton(button).row1 - 1
END IF
HSRel(numHSRel).col1 = GloWindow(windo).col1 _
+ GloButton(button).col1 - 1
HSRel(numHSRel).col2 = GloWindow(windo).col1 _
+ GloButton(button).col1 _
+ 2 _
+ LEN(RTRIM$(GloButton(button).text$))
HSRel(numHSRel).action = 1
HSRel(numHSRel).misc = GloButton(button).handle
HSRel(numHSRel).misc2 = GloButton(button).buttonType
' ========================================================
' Adjust previous info to handle special cases for
' "field" buttons, and "scroll bar" buttons.
' ========================================================
SELECT CASE GloButton(button).buttonType
CASE 4
numHSRel = numHSRel - 1
HSClick(numHSClick).row2 = GloWindow(windo).row1 _
+ GloButton(button).row2 - 1
HSClick(numHSClick).col2 = GloWindow(windo).col1 _
+ GloButton(button).col2 - 1
CASE 5
' numHSClick = numHSClick - 1
' HSRel(numHSRel).row2 = GloWindow(windo).row1 _
' + GloButton(button).row2 - 1
' HSRel(numHSRel).col2 = GloWindow(windo).col1 _
' + GloButton(button).col2 - 1
CASE 6
numHSRel = numHSRel - 1
HSClick(numHSClick).row2 = GloWindow(windo).row1 _
+ GloButton(button).row2 - 1
HSClick(numHSClick).col2 = GloWindow(windo).col1 _
+ GloButton(button).col1 - 1
CASE 7
numHSRel = numHSRel - 1
HSClick(numHSClick).row2 = GloWindow(windo).row1 _
+ GloButton(button).row1 - 1
HSClick(numHSClick).col2 = GloWindow(windo).col1 _
+ GloButton(button).col2 - 1
CASE ELSE
END SELECT
END IF
WEND
END IF
' ====================================================================
' EditFields are Click events
' ====================================================================
IF GloStorage.numEditFieldsOpen > 0 THEN
editField = 0
WHILE editField < GloStorage.numEditFieldsOpen
editField = editField + 1
IF GloEdit(editField).windowHandle = windo THEN
numHSClick = numHSClick + 1
HSClick(numHSClick).row1 = GloWindow(windo).row1 _
+ GloEdit(editField).row - 1
HSClick(numHSClick).row2 = GloWindow(windo).row1 _
+ GloEdit(editField).row - 1
HSClick(numHSClick).col1 = GloWindow(windo).col1 _
+ GloEdit(editField).col - 1
HSClick(numHSClick).col2 = GloWindow(windo).col1 _
+ GloEdit(editField).col _
+ GloEdit(editField).visLength - 1
HSClick(numHSClick).action = 2
HSClick(numHSClick).misc = GloEdit(editField).handle
END IF
WEND
END IF
' ====================================================================
' Feel free to add your own hot spots! One good idea is if the
' right hand side of the border is ▓, make that a scroll bar! Adding
' that would be good practice -- and fun too!
' ====================================================================
RETURN